/**
 * 管理后台首页相关JS
 * author: zhanghua 2015-9-9
 */
$(function(){
	$('#btnregister').click(function () {
		var username = $("#registerUserName").val();
		var code = $("#registerCode").val();
		var password = $("#registerPassword").val();
		if(username == null || username == ''){
			alert('注册手机不能为空')
		}
		if(code == null || code == ''){
			alert('验证码不能为空')
		}
		var data = {
			"username": username,
			"code" : code,
			"password" : password,
		};
		var postUrl = $('#postRegisterUrl').val()
		var jumpUrl = $('#jumpUrl').val();

		post_json(postUrl, data ,function(res){
			switch(res.status){
				case 1:
					location.href = jumpUrl;
					break;
				case 0:
					alert(res.msg);
					break;
			}
		});
		return false;
	});
});


